var utils = require("../../../../utils/util.js");
Page({
  data:{
    level:0,
    radioItems: [
      { name: '高', value: '1', checked: 'true' },
      { name: '中', value: '2' },
      { name: '低', value: '3' },
      { name: '计划', value: '4' }
    ]
  },
  formSubmit: function (event){
    let msg = event.detail.value;
    if (msg.title==""||msg.level==""){
      wx.showToast({
        title: '请输入完整信息！',
        icon: 'none',
        duration: 1000
      })
    }else{
      let itemList = wx.getStorageSync('itemList') || [];
      itemList.push({
        id: itemList.length,
        title:msg.title,
        level:msg.level
      });
      itemList = utils.dealItemList(itemList);
      wx.setStorageSync('itemList', itemList);
      wx.navigateBack({});
    }
  },
  formReset:function(){

  }
})